<?php

namespace api\ygzc\controller;

use think\facade\Db;
use cmf\controller\RestBaseController;

class LoginController extends RestBaseController
{
	// 初始化
    public function initialize()
    {
		
    }
	
	
	
	//获取版本信息
	public function index()
	{
		if ($this->request->isPost()) {
			$data = $this->request->param();
			$shop_name = !empty($data['shop_name']) ? $data['shop_name']:'';
			$ip =  get_client_ip(0, true);
			Db::name('merchant_login_log')->insert([
				'shop_name' 	=> $shop_name,
				'visit_time'	=> time(),
				'action'		=> '商城授权检测',
				'ip'			=> $ip,
				'domain'		=> $data['domain'], 
				'more'			=> json_encode($data)
			]);
			$this->success('请求成功');
		}else{
			$this->error("请求错误");
		}
	}
	
}
